package com.hhf.rpc.consumer;

import com.hhf.rpc.common.model.entity.User;
import com.hhf.rpc.common.service.UserService;
import com.hhf.rpc.easy.proxy.ServiceProxy;
import com.hhf.rpc.easy.proxy.ServiceProxyFactory;

/**
 * @Author hhf
 * @Date 2024/10/15
 * @Description
 */
public class EasyConsumerExample {

    public static void main(String[] args) {

        //创建对象
        User user = new User("hhf", "人生自古谁无死");

        //一句话调用远程服务
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);

        String result = userService.sayHello(user);
        System.out.println("调用成功,结果:\n" + result);


    }
}
